package com.dong.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//全面扩展springmvc
//如果你想diy一些定制化的功能，只需要写这个组件，然后将他交给springboot,然后springboot就会帮我们自动装配
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {

    //视图跳转
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("index"); //配置首页
        registry.addViewController("/index.html").setViewName("index"); //配置首页
        registry.addViewController("/main.html").setViewName("dashboard");

    }


}
